<!DOCTYPE html>
<html>
{include file="public/head"}
<body>
<div class="">
  <form action="{:url('admin/contest/search')}" method="post" class="layui-form" >
    <div style="text-align: center;">
      <div class="layui-input-inline">
        <div class="layui-form-item">
          <input type="text" name="keyword" placeholder="按题目ID或标题搜索" class="layui-input"/>
        </div>
      </div>
      <div class="layui-input-inline">
        <div class="layui-form-item">
          <input value="开始搜索" type="submit" class="layui-btn" />
        </div>
      </div> 
    </div>
  </form> 
  <div style="text-align: center;">
    {$page}
  </div>
  <div class="fly-panel" style="margin: 20px 40px 20px 40px;">
    <table class="layui-table">
      <colgroup>
        <col width="150">
        <col width="200">
      </colgroup>
      <thead>
        <tr>
          <th>ID</th>
          <th>Title</th>
          <th>StartTime</th>
          <th>EndTime</th>
          <th>Status</th>
          <th>Edit</th>
        </tr> 
      </thead>
      <tbody>      
        {foreach name="list" item="v"}
        <tr>
          <td>
            {$v['contest_id']}
          </td>
          <td>
            <a href="{:url('web/contest/show',['cid'=>$v['contest_id']])}">{$v['title']}</a>
          </td>
          <td>
            {$v['start_time']}
          </td>
          <td>
            {$v['end_time']}
          </td>
          <td>
            {$v['defunct']}
          </td>
          <td>
            <a href="{:url('admin/contest/editor_opt',['id'=>$v['contest_id'],'flag'=>'1'])}"><button class="layui-btn">编辑</button></a>
            <a><button class="layui-btn" onclick="del({$v['contest_id']})">删除</button></a>
          </td>
        </tr>
        {/foreach}
      </tbody>
    </table>
  </div>
  <div style="text-align: center;">
    {$page}
  </div>
</div>
{include file="public/end"}
<script type="text/javascript">
  function del(id) {
    if(confirm('确定删除？')) {
      location.href="{:url('admin/contest/del')}"+'?id='+id;
    }
  }
</script>
</html>